package com.rwb.reconciliation.sync;

import com.rwb.reconciliation.utils.FileUtil;

import java.io.File;
import java.util.concurrent.Callable;

/**
 * @Auther: ruwenbo
 * @Date: 2018/9/23 13:53
 * @Description:
 */
public class FutureFileParser implements Callable {

    /**
     * 需要下载的文件名
     */
    private String downloadFileName;

    public FutureFileParser(String downloadFileName) {
        this.downloadFileName = downloadFileName;
    }

    @Override
    public Object call() throws Exception {
        // 1. 从ftp下载文件到本地
        File file = FileUtil.downLoadFile(downloadFileName, null);

        // 2. 将文件解析为List<String>
        return FileUtil.parseFile(file);
    }
}
